package com.gc.ykqx.service;

import com.gc.ykqx.service.entity.AppInfo;
import com.gc.ykqx.service.entity.Fore;
import com.gc.ykqx.service.entity.Fylz;
import com.gc.ykqx.service.entity.LatestWea;
import com.gc.ykqx.service.entity.Past24;
import com.gc.ykqx.service.entity.SiteResponse;
import com.gc.ykqx.service.entity.Warn;
import com.gc.ykqx.service.entity.WeaResponse;

import retrofit2.http.GET;
import retrofit2.http.Query;
import retrofit2.http.Url;
import rx.Observable;

/**
 * Created by wsd on 2017/9/30.
 */

public interface RetrofitService {

    /*
    获取区域站信息
     */
    @GET("sta/getStaInfoByRegionCodeandStaIndesandEleType?userid=aa&pwd=123&dataformat=json" +
            "&elements=stationId,station_name,lat,lon&adminCodes=330784&eleTypes=T,R,F&staIndes=1,2")
    Observable<SiteResponse> getQySite();

    /*
    获取水文站信息
    */
    @GET("sta/getStaInfoByRegionCodeandStaIndesandEleType?userid=aa&pwd=123&dataformat=json" +
            "&elements=stationId,station_name,lat,lon&adminCodes=330784&staIndes=6&eleTypes=R")
    Observable<SiteResponse> getSwSite();

    /*
    查询分钟表资料
     */
    @GET("mul_min/getSurfEleByTimeAndStaID?userid=aa&pwd=123&dataformat=json&orderBy=stationId:desc&limitCnt=100")
    Observable<WeaResponse> getWeaMin(@Query("staIds") String staIds, @Query("times") String time, @Query("elements") String element);

    /*
    查询小时表资料
    */
    @GET("mul_hor/getSurfEleByTimeAndStaID?userid=aa&pwd=123&dataformat=json&orderBy=stationId:desc&limitCnt=100")
    Observable<WeaResponse> getWeaHor(@Query("staIds") String staIds, @Query("times") String time, @Query("elements") String element);

    /*
    查询日表资料 &elements=stationId,observTimes,maxTemp&times=20171006010000&staIds=58444,58477"
    */
    @GET("mul_day/getSurfEleByStaIDAndTimes?userid=aa&pwd=123&dataformat=json")
    Observable<WeaResponse> getWeaDay(@Query("staIds") String staIds, @Query("time") String time, @Query("elements") String element);

    /*
    查询分钟统计表资料 &staIds=58643&times=20171005010000&elements=stationId,datetime,Pre_Sum_h20
    10min 30min 1h 3h 6h
    http://122.224.174.179:9990/evs_min/getSurfEleByTimeAndStaID?userid=aa&pwd=123&dataformat=json&limitCnt=100&orderBy=stationId:desc&elements=stationId,Pre_Sum_1h&times=20171015180000&staIds=58643,K6019
    */
    // @GET("evs_min/getSurfLatestTimeByStaID?userid=aa&pwd=123&dataformat=json&limitCnt=100")
    @GET("evs_min/getSurfEleByTimeAndStaID?userid=aa&pwd=123&dataformat=json&limitCnt=100&orderBy=stationId:desc")
    Observable<WeaResponse> getWeaEvsByTimeAndStaIds(@Query("staIds") String staIds, @Query("times") String time, @Query("elements") String element);

    /*
    查询分钟统计表资料
    20时以来 08时以来
    http://122.224.174.179:9990/evs_min/getSurfLatestTimeByStaID?userid=aa&pwd=123&dataformat=json&limitCnt=100&elements=stationId,datetime,Pre_Sum_h08&staIds=58643,k6211
     */
    @GET("evs_min/getSurfLatestTimeByStaID?userid=aa&pwd=123&dataformat=json&limitCnt=100")
    Observable<WeaResponse> getWeaEvsByStaIds(@Query("staIds") String staIds, @Query("elements") String element);

    /*
    整点以来 （降水）
    http://122.224.174.179:9990/mul_min/getSurfLatestTimeByStaID?userid=wlzx&pwd=123&dataformat=json&elements=stationId,observTimes,PrecipitationFromHour&staIds=58643,k6211
     */
    @GET("mul_min/getSurfLatestTimeByStaID?userid=wlzx&pwd=123&dataformat=json")
    Observable<WeaResponse> getWeaFromHour(@Query("staIds") String staIds, @Query("elements") String element);

    /*
    查询水文站小时资料
    //    http://122.224.174.179:9990/out_mul_hor/getSurfEleByTimeAndStaID?userid=aa&pwd=123&dataformat=json&elements=stationId,observTimes,precipitation
                // &orderBy=precipitation:desc,stationId:desc&limitCnt=100&staIds=RG100&times=20171006010000
    */
    @GET("out_mul_hor/getSurfEleByTimeAndStaID?userid=aa&pwd=123&dataformat=json&orderBy=stationId:desc&limitCnt=100")
    Observable<WeaResponse> getWeaSwHor(@Query("staIds") String staIds, @Query("times") String time, @Query("elements") String element);

    /*
    统计日降水 岂止时间降水
     */
    @GET("mul_day/getSurfEleByTimeTypeAndStaIDAndBeginEndTime?userid=wlzx&pwd=123&dataformat=json&timeType=H")
    Observable<WeaResponse> getWeaDayCount(@Query("staIds") String staIds, @Query("elements") String element, @Query("begintime") String beginTime, @Query("endtime") String endTime);

    /*
    统计小时降水 岂止时间降水
   */
    @GET("mul_hor/getSurfEleByTimeTypeAndStaIDAndBeginEndTime?userid=wlzx&pwd=123&dataformat=json&timeType=H")
    Observable<WeaResponse> getWeaHorCount(@Query("staIds") String staIds, @Query("elements") String element, @Query("begintime") String beginTime, @Query("endtime") String endTime);

    /*
    统计分钟降水 岂止时间降水
     */
    @GET("mul_min/getSurfEleByTimeTypeAndStaIDAndBeginEndTime?userid=wlzx&pwd=123&dataformat=json&timeType=H")
    Observable<WeaResponse> getWeaMinCount(@Query("staIds") String staIds, @Query("elements") String element, @Query("begintime") String beginTime, @Query("endtime") String endTime);

    /*
     获取预警信息
    */
    @GET("yj/getSurfEle?userid=aa&pwd=123&dataformat=json&elements=unitname,unitlat,unitlng,yjvalidtime,yjch,yjptime")
    Observable<Warn> getWarn();

    /*
     首页定位后站点最新天气信息
    */
    @GET("mul_hor/getSurfLatestTimeByStaID?userid=wlzx&pwd=123&dataformat=json&limitCnt=100&elements=stationId,observTimes,visibility,relHumidity,stationPress,windVelocity,precipitation,dryBulTemp")
    Observable<LatestWea> getLatestWea(@Query("staIds") String staIds);

    /*
    负氧离子数据
   */
    @GET("pic/getFYLZ")
    Observable<Fylz> getFylz();

    /*
    获取预报信息
    param 6 短时 2 短期 5一周
   */
    @GET("fore_text/getSurfLatestTimeByStaID?userid=aa&pwd=123&dataformat=json&elements=FILE_Type,FILE_Text&staIds=58643")
    Observable<Fore> getFore(@Query("fileType") String fileType);

    /*
    获取过去24小时
   */
    @GET("mul_hor/getSurfEleByTimeTypeAndStaID?userid=aa&pwd=123&dataformat=json&elements=stationId,observTimes,precipitation,dryBulTemp,windVelocity&timeType=H&timeCnt=-24")
    Observable<Past24> getPast(@Query("staIds") String staIds);

    /*
   获取过去24小时
  */
    @GET("pic/updateApp")
    Observable<AppInfo> getAppInfo();

    /*
    获取水文站信息
    */
    @GET("pic/updateApp")
    Observable<AppInfo> demo(@Url String url);
}
